import { runInAction, makeAutoObservable } from 'mobx';

export default makeAutoObservable({
    count: 0,
    addCount() {
        console.log(this);
        this.count += 1;
    },
    asyncAddCount() {
        setTimeout(() => {
            runInAction(() => { // 异步内需要
                this.count += 10;
            });
        }, 2000);
    },
});
